Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

200
Views
Error while importing electron in react | import { ipcRenderer } from 'electron'

I have created a simple react app with create-react-app and I have integrated it with electron successfully. Everything was working great until I tried to import electron inside the action creator file. If I remove the line below, the app works fine. The problem is that I can't use the ipcRenderer to communicate from the react side to the electron main process.

This line causes the app to crash: import { ipcRenderer } from 'electron';

I get the following error:

TypeError: fs.existsSync is not a function (anonymous function) node_modules/electron/index.js:6

3 | 4 | var pathFile = path.join(__dirname, 'path.txt') 5 |

6 | if (fs.existsSync(pathFile)) { 7 | module.exports = path.join(__dirname, fs.readFileSync(pathFile, 'utf-8')) 8 | } else { 9 | throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!